package com.itheima.day15.work1;

import java.io.IOException;
import java.net.*;

public class ClientDemo {
    //发送端
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket();//socket 套接字
        String s="哈喽，您好世界1" ;
        byte[] bytes = s.getBytes();
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        int port=10000;
        DatagramPacket dp=new DatagramPacket(bytes,bytes.length,byName,port);//数组数据，数组长度，地址，端口
        ds.send(dp);
        ds.close();
    }
}
